<?php

namespace App\Models\customer;

use App\Models\AdminModel;
use App\Models\airline\base\RouteModel;
use App\Models\base\CurrencyModel;
use App\Models\base\SubjectModel;
use App\Models\CustomerModel;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model as BaseModel;


class RepairModel extends BaseModel
{
    use HasFactory, SoftDeletes;

    protected $table = 't_customer_repair';

    protected $primaryKey = 'id';

    public $timestamps = true;

    const CREATED_AT = 'created_at';
    
    const UPDATED_AT = null;

    protected $guarded = [];

    protected $hidden = [
        'deleted_at',
    ];



    //创建人
    public function create_admin(): BelongsTo {
        return $this->belongsTo(AdminModel::class, 'created_admin_id');
    }

    //币种
    public function currency(): BelongsTo {
        return $this->belongsTo(CurrencyModel::class, 'currency_id');
    }

    //科目
    public function subject(): BelongsTo {
        return $this->belongsTo(SubjectModel::class, 'subject_id');
    }
}
